

// 底部主导航
let mainLinks = document.querySelectorAll('footer dl')
console.log(mainLinks)
mainLinks[0].onclick=function(){
	location.href='index-jxAll.html'
}
mainLinks[1].onclick=function(){
	location.href='classifyBrandStore.html'
}
mainLinks[2].onclick=function(){
	location.href='index-FashonTop.html'
}
mainLinks[3].onclick=function(){
	location.href='cart.html'
}
mainLinks[4].onclick=function(){
	location.href='Myself.html'
}


//精选页面上导航
let jxMaincontents = document.querySelectorAll('main')
console.log(jxMaincontents)

let jxMainLinks = document.querySelectorAll('.jx-headerNav li')
console.log(jxMainLinks)
let jxMainLinksFonts = document.querySelectorAll('.jx-headerNav li a')
for(let i=0;i<jxMainLinks.length;i++){
	jxMainLinks[i].onclick=function(){
		console.log(i)
		for(let j=0;j<jxMainLinks.length;j++){
			jxMaincontents[j].style.display='none'
			jxMainLinksFonts[j].className=''
		}
		jxMainLinksFonts[i].className='active'
		jxMaincontents[i].style.display='block'
	}
}


//精选  全部（首页）轮播图效果
var mySwiper = new Swiper('.swiper-container',{
	direction:'horizontal',
	loop:true,
	speed:1000,
	pagination:{
		el:'.swiper-pagination',
		clickable:true,
		bulletActiveClass:'my-bullet-active',
		bulletElement : 'li',
	},
	autoplay:{
		delay:400,
	},
	effect : 'coverflow',
})
let jxAllbanner = document.querySelector('#jxAll-banner')
if(jxAllbanner){
	jxAllbanner.onclick=function(){
		location.href='productstList.html';
	}
}







/* *****************分类页  一级导航*********************** */
let cfNavButtons = document.querySelectorAll('#classify-header li') 
let cfMains = document.querySelectorAll('.classify-brandC') 
console.log(cfNavButtons)
console.log(cfMains)
for(let i=0;i<cfNavButtons.length;i++){
	cfNavButtons[i].onclick=function(){
		for(let j=0;j<cfNavButtons.length;j++){
			cfNavButtons[j].className='';
			cfMains[j].style.display='none';
		}
		cfNavButtons[i].className='active';
		cfMains[i].style.display='block';
	}
}

/* *****************分类页侧边导航栏*********************** */
let sideBar1Buttons = document.querySelectorAll('.classify-brandC .sideBar1 li')
console.log(sideBar1Buttons)
let sideBar2Buttons = document.querySelectorAll('.classify-brandC .sideBar2 li')
function addClickNavEvents(els,box){
	for(let i=0;i<els.length;i++){
		els[i].onclick=function(){
			for(let j=0;j<els.length;j++){
				els[j].className=""
			}
			els[i].className="active"
		}
	}
}
addClickNavEvents(sideBar1Buttons)
addClickNavEvents(sideBar2Buttons)

